{% extends "base.html" %}

{% block content %}
  <table id="data" class="table table-striped">
    <thead>
      <tr>
        <th>Resource Name</th>
        <th>Resource Id</th>
        <th>Resource Type</th>
        <th>Environment</th>
        <th>Created By</th>
        <th>Created At</th>
        <th>Last modified At</th>
      </tr>
    </thead>
    <tbody>
      {% for resource in resources %}
        <tr>
          <td>{{ resource.display_name }} </td>
          <td>{{ resource.entity_id }}</td>
          <td>{{ resource.entity_type }}</td>
          <td><a href="/env/{{ resource.environment_id }}">{{ resource.environment_id }}</a> </td>
          <td>{{ resource.created_by.email }}</td>
          <td>{{ resource.created_at }}</td>
          <td>{{ resource.last_modified_at }}</td>
          <td><a href="/env/{{ resource.environment_id }}/{{resource.entity_type}}/{{ resource.entity_id }}">Raw</a> </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% endblock %}

{% block scripts %}
  <script>
    $(document).ready(function () {
      $('#data').DataTable({
        scrollX: true
      });
    });
  </script>
{% endblock %}